package botsavesprincess;

import java.util.Scanner;

public class Solution {
	/* Head ends here */
	static void displayPathtoPrincess(int n, String [] grid){
		int pr = 0, pc = 0, mr = n / 2, mc = n / 2;
		if(grid[0].charAt(n - 1) == 'p')
			pc = n - 1;
		else if(grid[n - 1].charAt(0) == 'p')
			pr = n - 1;
		else if(grid[n - 1].charAt(n - 1) == 'p')
			pr = pc = n - 1;
		for(int i = mr - 1; i >= pr; i--)
			System.out.println("UP");
		for(int i = mr + 1; i <= pr; i++)
			System.out.println("DOWN");
		for(int i = mc - 1; i >= pc; i--)
			System.out.println("LEFT");
		for(int i = mc + 1; i <= pc; i++)
			System.out.println("RIGHT");
	}
	/* Tail starts here */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int m;
		m = in.nextInt();
		String grid[] = new String[m];
		for(int i = 0; i < m; i++) {
			grid[i] = in.next();
		}
		in.close();
		displayPathtoPrincess(m,grid);
	}
}
